# 计算器
try:
    NumRight = True
    while NumRight:
        try:
            data1 = float(input("Please enter the first piece of data"))
        except Exception as e:
            print("There is a problem with your input. Please re-enter")
        else:
            NumRight = False
    operRight = True
    oper = '';
    while operRight:
        oper = input("Please enter the operator")
        if oper not in ("+","-","*","/"):
            print("The operator input is incorrect. Please re-enter")
        else :
            operRight = False
    NumRight = True
    while NumRight:
        try:
            data2 = float(input("Please enter the second piece of data"))
            if oper == '/' and data2 == 0:
                print("Please re-enter. The divisor cannot be 0")
                data = data1/data2
        except Exception as e:
            print("There is a problem with the data you entered. Please re-enter it")
        else:
            NumRight = False
    print(str(data1) + " , " + oper + " , " + str(data2))
    if oper == '+':
        print("最终结果"+str(data1 + data2))
    elif oper == '-':
        print("最终结果" + str(data1 - data2))
    elif oper == '*':
        print("最终结果" + str(data1 * data2))
    elif oper == '/':
        print("最终结果" + str(data1 / data2))
    else:
        print("功能还未开发，敬请期待")
except Exception as e:
    print("发生Exception错误")
except KeyboardInterrupt as k:
    print("发生KeyboardInterrupt错误")
else:
    print("The end")